<template>
  <div class="category">
    <h3>{{ title }}分类</h3>
    <!-- 定义一个默认插槽-->
    <slot :games="games">这是默认值，如果没有传递结构时显示1</slot>
  </div>
</template>

<script>
export default {
  name: "Category",
  props: ['title'],
  data() {
    return {
      games: ['命运', '明日方舟', '元神', 'apex']
    };
  }
}
</script>

<style scoped>
.category {
  background-color: #5bc0de;
  width: 200px;
  height: 300px;
}

h3 {
  text-align-last: center;
  background-color: orange;
}

img {
  width: 100%;
}
</style>